<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of View
 *
 * @author Andriy
 */
class Core_View
{
    protected $_variables = array();

    protected $_layout = null;

    public function setLayout( Core_Layout_Abstract $layout )
    {
        $this->_layout = $layout;
    }

    public function  __set($name, $value)
    {
        $this->_layout->assign( $name, $value );
        $this->_variables[$name] = $value;
    }

    public function  __get($name)
    {
        if( !isset( $this->_variables[$name] ) )
        {
            return false;
        }

        $this->_layout->assign( $name, $value );
        return $this->_variables[$name];
    }

    

}
?>
